// ----------------------------------
// RSDK Project: Sonic 1/Sonic 2
// Script Description: ST Screen Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

// Aliases
private alias 2 : TYPE_STSCREEN


event ObjectMain
	switch object.state
	case 0
		stage[0].activeLayer = 1
		object.value0 = 320
		object.state++
		SetScreenFade(0, 0, 0, 255)
		break
	case 1
		if object.value0 > 0
			object.value0 -= 16
		else
			object.state++
			
		end if
		SetScreenFade(0, 0, 0, object.value0)
		break
	case 2
		object.value0++
		if object.value0 == 90
			object.value0 = 0
			object.state++
		end if
		break
	case 3
		if object.value0 < 320
			object.value0 += 12
		else
			ResetObjectEntity(object.entityPos, TypeName[ST Logo], 0, object.xpos, object.ypos)
		end if
		SetScreenFade(0, 0, 0, object.value0)
		break
	end switch
	temp0 = screen.xcenter
	FlipSign(temp0)
	temp0 += 256
	screen.xoffset = temp0
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
